package nx.simple3d.data.worker;

import nx.simple3d.gui.Nx3DCanvas;

public class RenderWorker implements Runnable{
  
  private boolean isRunning = true;
  private Nx3DCanvas canvas;
  
  public RenderWorker(Nx3DCanvas canvas){
    this.canvas = canvas;
  }
  
  public void run() {
    while(isRunning) {
      canvas.render();
    }
    isRunning = true;
  }
  
  public void stop(){
    isRunning = false;
  }
}
